PurityExtension

abstract class PurityExtension

shared.purity — a reusable dependency-purity tripwire. A module declares a list of coordinate substrings that must never appear on its resolved runtime classpath; the registered checkPurity task (wired into check) fails the build if any do. Keeps a "pure leaf" module (engine / domain / pure algorithms) honest without standing up a full dependency-guard baseline.

plugins { id("shared.purity") }
purity {
    forbidden.set(listOf("androidx.compose", "io.ktor", "kotlinx-coroutines"))
    // configuration defaults to "jvmRuntimeClasspath"
}

Configuration-cache safe: the resolved coordinates are read through a NamedDomainObjectProvider (a serializable handle), not a live ConfigurationContainer, so the task action never derefs the project at execution.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
abstract val configuration: Property<String>

Which resolvable configuration to inspect. Defaults to jvmRuntimeClasspath.

Link copied to clipboard
abstract val forbidden: ListProperty<String>

Coordinate substrings that must not appear on the resolved configuration. Empty = no-op.